import java.util.Arrays;

public class E02_FibonacciThread {

	public static void main(String[] args) {
		for (int i = 1; i < 10; i++) {
			Thread t = new Thread(new Fibonacci(i));
			t.start();
		}
	}

}

class Fibonacci implements Runnable {
	public static int taskCount = 0;
	public final int id = taskCount++;
	public int n;

	private Integer[] sequence;

	public Fibonacci(int n) {
		this.n = n;
		sequence = new Integer[n];
	}

	@Override
	public void run() {
		for (int i = 0; i < n; i++) {
			sequence[i] = fib(i);
		}
		System.out.println("seq " + id + ": " + Arrays.toString(sequence));
	}

	public int fib(int n) {
		if (n < 2) {
			return 1;
		} else {
			return fib(n - 1) + fib(n - 2);
		}
	}
}
